String callHttps(String url, String &payload)
{
  Serial.print("callHttps requesting URL: ");
  Serial.println(url);
  HTTPClient https;
  bool httpsOn =https.begin(url); 
  if (!httpsOn)
  {
    httpsOn =https.begin(url);  //reconnect
  }
  if (httpsOn)
  {
    https.setTimeout(10*1000);
    int httpsCode = https.GET();
    Serial.println("callHttps get return code: "+String(httpsCode));
    if (httpsCode<=0)
    {
      httpsCode = https.GET();//reget
      Serial.println("callHttps reget return code: "+String(httpsCode));
    }
    if (httpsCode > 0)  //判断有无返回值
    {
      /*payload = https.getString();
      Serial.println(payload);
      return payload;*/
      if (httpsCode == 200 || httpsCode == 304 || httpsCode == 403 || httpsCode == 404 || httpsCode ==   500) //判断请求是正确
      {
        Serial.println("callHttps sizes: " + String(https.getSize()));
        payload = https.getString();
//        Serial.println(payload);
        Serial.println("callHttps getString OK len: " +String(payload.length()));
      }
      else
      {
        Serial.print("请求错误："); Serial.println(httpsCode); Serial.println(" ");
        char* httpsCode_c = new char[8];
        itoa(httpsCode, httpsCode_c, 10); //int转char*
        payload = "{\"status_code\":\"" + String("请求错误:") + String(httpsCode_c) + "\"}";
        delete httpsCode_c;
      }
    }
    else
    {
      Serial.println(" "); Serial.print("GET请求错误："); Serial.println(httpsCode);
      Serial.printf("[HTTPS] GET... 失败, 错误: %s\r\n", https.errorToString(httpsCode).c_str());
      payload = "{\"status_code\":\"" + String(https.errorToString(httpsCode).c_str()) + "\"}";
      //Serial.println(payload);
    }
  }
  else
  {
    Serial.printf("[HTTPS] 无法连接服务器\r\n");
    payload = "{\"status_code\":\"" + String("无法连接服务器") + "\"}";
  }
  https.end();
  return payload;
}
